<?php
namespace app\agent\service;

use app\agent\logic\WkSellerexLogic;
use app\agent\servlet\WkSellerexServlet;

class WkSellerexService extends BaseService
{
	private $wkSellerex = null;
	
	private $servlet = null;
	
	public function __construct()
	{
		parent::__construct();
		
		$this->wkSellerex = new WkSellerexLogic();
		
		
		$this->servlet = new WkSellerexServlet();
		
	}

	/**
	* @action 店铺基本信息详情
	*/
	public function getViewDetail($data = [])
	{
		$where = $this->servlet->getWhere($data);

		$data = $this->wkSellerex->getDetail($where);

		if ( $data === false )
		{
			$this->error = $this->wkSellerex->getError();

			return false;
		}
		
		return $data;
	}

    public function getViewPage($request = [])
    {
        $request = $this->servlet->collating($request);

        $where = $this->servlet->getWhere($request);

        $data = $this->wkSellerex->getPage($where, $request);

        $data = [
            'data'      => $data,
            'status'    => $this->wkSellerex->_map['status'],
        ];

        return $data;
    }


    public function getExcel($request = [])
    {
        $request = $this->servlet->collating($request);

        $where = $this->servlet->getWhere($request);

        $data = $this->wkSellerex->getExcel($where, $request);

        $data = [
            'data'      => $data,
            'status'    => $this->wkSellerex->_map['status'],
        ];

        return $data;
    }
}